<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>


</head>
<body>
<input type="text" id="i1">
<input type="button" value="添加一号女嘉宾" onclick="f(1)">
<input type="button" value="添加二号女嘉宾" onclick="f(2)">

<script>
    let n = document.querySelector("#i1")

    function f(x) {
        let imgName = x == 1 ? "../b2.jpeg" : "../b3.jpeg";
        for (let i = 0; i < n.value; i++) {
            let img = document.createElement("img");
            img.src = imgName;
            document.body.append(img)
        }
    }

    /* let n = document.querySelector("#i1")
     function f1() {
         for (let b = 0;b<n.value;b++){

         }
     }
     function f2() {
         for (let b = 0;b<n.value;b++){
             let i = document.createElement("img");
             i.src="../b3.jpeg";
             document.body.append(i)
         }
     }*/
</script>

</body>
</html>